<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./css/main.css" />
  </head>
  <body>
    <div id="carousel">
      <div id="carouselImgs">
        <div><img src="./imgs/1.png" /></div>
        <div><img src="./imgs/2.png" /></div>
        <div><img src="./imgs/3.png" /></div>
        <div><img src="./imgs/4.png" /></div>
        <div><img src="./imgs/5.png" /></div>
        <div><img src="./imgs/6.png" /></div>
        <div><img src="./imgs/7.png" /></div>
        <div><img src="./imgs/8.png" /></div>
        <div><img src="./imgs/9.png" /></div>
        <div><img src="./imgs/10.png" /></div>
      </div>
      <div id="preBtn">←</div>
      <div id="nextBtn">→</div>
    </div>
    <script>
      const preBtn = document.getElementById("preBtn");
      const nextBtn = document.getElementById("nextBtn");
      const carouselImgs = document.getElementById("carouselImgs");

      preBtn.onclick = function () {
        carouselImgs.style.marginLeft = carouselImgs.offsetLeft - 300 + "px";
      };
      nextBtn.onclick = function () {
        carouselImgs.style.marginLeft = carouselImgs.offsetLeft + 300 + "px";
      };
    </script>
  </body>
</html>
